MapboxRouteLineApiExtensions

object MapboxRouteLineApiExtensions

Extension functions for MapboxRouteLineApi calls that are implemented as callbacks. This offers an alternative to those callbacks by providing Kotlin oriented suspend functions.

Functions

clearRouteLine
Link copied to clipboard
suspend fun MapboxRouteLineApi.clearRouteLine(): Expected<RouteLineError, RouteLineClearValue>
Clears the route line data.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
findClosestRoute
Link copied to clipboard
suspend fun MapboxRouteLineApi.findClosestRoute(target: Point, mapboxMap: MapboxMap, padding: Float): Expected<RouteNotFound, ClosestRouteValue>
The map will be queried for a route line feature at the target point or a bounding box centered at the target point with a padding value determining the box's size.
getRouteDrawData
Link copied to clipboard
suspend fun MapboxRouteLineApi.getRouteDrawData(): Expected<RouteLineError, RouteSetValue>
hashCode
Link copied to clipboard
open fun hashCode(): Int
setAlternativeTrafficColor
Link copied to clipboard
fun Expected<RouteLineError, RouteSetValue>.setAlternativeTrafficColor(expression: Expression): Expected<RouteLineError, RouteSetValue>
Overrides the color Expression for the alternative traffic lines with the Expression provided.
fun Expected<RouteLineError, RouteSetValue>.setAlternativeTrafficColor(@ColorInt() color: Int): Expected<RouteLineError, RouteSetValue>
Overrides the color Expression for the alternative traffic lines with the color indicated.
setNavigationRouteLines
Link copied to clipboard
suspend fun MapboxRouteLineApi.setNavigationRouteLines(newRoutes: List<NavigationRouteLine>): Expected<RouteLineError, RouteSetValue>
Sets the routes that will be operated on.
setNavigationRoutes
Link copied to clipboard
suspend fun MapboxRouteLineApi.setNavigationRoutes(newRoutes: List<NavigationRoute>): Expected<RouteLineError, RouteSetValue>
Sets the routes that will be operated on.
setPrimaryTrafficColor
Link copied to clipboard
fun Expected<RouteLineError, RouteSetValue>.setPrimaryTrafficColor(expression: Expression): Expected<RouteLineError, RouteSetValue>
Overrides the color Expression for the primary traffic line with the Expression provided.
fun Expected<RouteLineError, RouteSetValue>.setPrimaryTrafficColor(@ColorInt() color: Int): Expected<RouteLineError, RouteSetValue>
Overrides the color Expression for the primary traffic line with the color indicated.
setRoutes
Link copied to clipboard
suspend fun MapboxRouteLineApi.setRoutes(newRoutes: List<RouteLine>): Expected<RouteLineError, RouteSetValue>
Sets the routes that will be operated on.
showRouteWithLegIndexHighlighted
Link copied to clipboard
suspend fun MapboxRouteLineApi.showRouteWithLegIndexHighlighted(legIndex: Int): Expected<RouteLineError, RouteLineUpdateValue>
If successful this method returns a RouteLineUpdateValue that when rendered will display the route line with the route leg indicated by the provided leg index highlighted.
toString
Link copied to clipboard
open fun toString(): String